<?php


namespace app\queue\stomp;


use app\queue\BaseConsumer;
use common\service\TaskWorkOrderService;
use common\service\UserService;

class RepairTaskSuccessWorkOrderMessageNotifyConsumer extends BaseConsumer
{
    // 要消费的队列名
    public $queue = 'repair_task_success_work_order_message_notify';

    // 连接名，对应 config/redis_queue.php 里的连接`
    public $connection = 'default';

    /**
     * 返修任务成功工单消息推送
     * @param $data
     * @return mixed|void
     * @throws \Exception
     */
    public function doConsume($data)
    {
        try {
            TaskWorkOrderService::getInstance()->repairWorkOrderTaskRepairSuccessMessage($data["data"]);
        } catch (\Throwable  $e) {
            trace(format_exception_info($e), 'ERR');
        }
    }
}